home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Aminet
/
dev
/
c
/
ctags.lha
/
ctags-3.0.3
/
Makefile.maint
< prev
next >
Wrap
Makefile
|
1999-02-17
|
8KB
|
304 lines
#*****************************************************************************
# $Id: Makefile.maint,v 7.4 1998/12/21 05:58:03 darren Exp darren $
#
# Development makefile for Exuberant Ctags, used to build releases.
#
# Copyright (c) 1996-1998, Darren Hiebert
#*****************************************************************************
SOURCES = eiffel.c entry.c fortran.c get.c keyword.c main.c options.c \
parse.c read.c sort.c vstring.c
DSOURCES = $(SOURCES) debug.c
HEADERS = ctags.h debug.h entry.h general.h get.h keyword.h main.h \
options.h parse.h read.h sort.h vstring.h
VERSION_FILES= ctags.h ctags.1 ctags.lsm NEWS
DIST_FILES = COPYING FAQ INSTALL INSTALL.DOS QUOTES README \
Makefile.in configure.in acconfig.h mkinstalldirs \
Makefile.amiga Makefile.bcc Makefile.djg Makefile.maint \
Makefile.os2 Makefile.w32 descrip.mms \
$(DSOURCES) strstr.c $(HEADERS) ctags.1 ctags.lsm NEWS
DOS_FILES = COPYING FAQ INSTALL.DOS QUOTES README \
Makefile.amiga Makefile.bcc Makefile.djg \
Makefile.os2 Makefile.w32 \
$(DSOURCES) $(HEADERS)
RCS_FILES = $(DIST_FILES) ctags.spec
WARNINGS = -Wall -W -Wtraditional -Wpointer-arith -Wcast-align \
-Wwrite-strings -Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -Wcast-qual -Wshadow \
-pedantic -Wstrict-prototypes # -Wconversion -Werror
ERRFILE = errors
REDIR = 2>&1 | tee $(ERRFILE)
RPM_ROOT= $(HOME)/Develop
CTAGS_DOSDIR = /mnt/dos/ctags
WEB_ARCHIVE_DIR = $(HOME)/public_html/archives
DEP_DIR = .deps
CC = egcs
DEFS = -I. -DHAVE_CONFIG_H
CFLAGS = $(DEFS)
OPT = -O3
DCFLAGS = $(CFLAGS) -DDEBUG -DINTERNAL_SORT
DLFLAGS = -lefence
LD = gcc
AUTO_GEN = configure config.h.in
CONFIG_GEN = config.cache config.log config.status config.run config.h Makefile
PROF_GEN = gmon.out
COV_GEN = *.da *.gcov
#
# Targets
#
ifeq ($(findstring clean,$(MAKECMDGOALS)),)
ifneq ($(MAKECMDGOALS),setup)
ifeq ($(wildcard config.h),)
ctags dctags ctags.prof ctags.cov:
$(MAKE) config.h
$(MAKE) $(MAKECMDGOALS)
else
all: ctags dctags tags syntax.vim
include $(DSOURCES:%.c=$(DEP_DIR)/%.d)
#
# Executable targets
#
ctags: $(SOURCES:.c=.o)
@ echo "-- Linking $@"
@ $(LD) $(LFLAGS) $^ -o $@
dctags: $(SOURCES:.c=.od) debug.od
@ echo "-- Building $@"
@ $(LD) $(LFLAGS) $^ -o $@
ctags.prof: $(SOURCES) $(HEADERS) Makefile
$(CC) -pg $(CFLAGS) $(WARNINGS) $(SOURCES) -o $@
ctags.cov: $(SOURCES) $(HEADERS) Makefile
$(CC) -fprofile-arcs -ftest-coverage $(CFLAGS) $(WARNINGS) $(SOURCES) -o $@
gcov: $(SOURCES:.c=.c.gcov)
endif
endif
endif
ctags32.exe: $(SOURCES) $(HEADERS)
gcc-dos -DMSDOS -O4 -Wall -s -o $@ $(SOURCES)
#
# Support targets
#
FORCE:
config.h.in: acconfig.h configure.in
autoheader
@ touch $@
configure: configure.in
autoconf
config.h: config.h.in configure
./configure --enable-maintainer-mode
@ touch $@
depclean:
rm -f $(DEP_DIR)/*.d
profclean:
rm -f $(PROF_GEN)
gcovclean:
rm -f $(COV_GEN)
clean: depclean profclean gcovclean
rm -f *.[oi] ctags dctags ctags*.exe ctags.man \
ctags.prof ctags.cov *.bb *.bbg tags TAGS syntax.vim $(ERRFILE)
distclean: clean
rm -f $(CONFIG_GEN)
maintainer-clean maintclean: distclean
rm -f $(AUTO_GEN)
ctags.man: ctags.1
@ groff -Tascii -mandoc $< | sed 's/.//g' > $@
tags: $(DSOURCES) $(HEADERS)
@ echo "-- Building tag file"
@ ctags $^
#
# Create a Vim syntax file for all typedefs
#
syntax: syntax.vim
syntax.vim: $(DSOURCES) $(HEADERS)
@ echo "-- Generating syntax file"
@ ctags -i=ctS -o- $^ |\
awk 'BEGIN{printf("syntax keyword Typedef\t")}\
{printf("%s ", $$1)}END{print ""}' > $@
#
# RCS management
#
co:
-@ (cd RCS; rlog -L -R * | sed -e 's/,v$$//')
checkin:
@ ci -u `rlog -L -R RCS/* | sed -e 's:RCS/::' -e 's/,v$$//'`
rcs-release:
-co -l $(RCS_FILES)
ci -u -f7.1 -n"V3_0" -m"Formal release of 3.0" $(RCS_FILES)
rcs-files:
@ls -1 $(RCS_FILES)
#
# Release management
#
ctags-%.tar.gz: $(DIST_FILES) $(VERSION_FILES)
@ echo "---------- Building tar ball"
if [ -d ctags-$* ] ;then rm -fr ctags-$** ;fi
mkdir ctags-$*
cp -p $(DIST_FILES) ctags-$*/
for file in $(VERSION_FILES) ;do \
rm -f ctags-$*/$${file} ;\
sed -e "s/@@VERSION@@/$*/" \
-e "s/@@LSMDATE@@/`date +'%d%b%y' | tr 'a-z' 'A-Z'`/" \
$${file} > ctags-$*/$${file} ;\
done
chmod 644 ctags-$*/*
chmod 755 ctags-$*/mkinstalldirs
(cd ctags-$*; autoheader; chmod 644 config.h.in)
(cd ctags-$*; autoconf; chmod 755 configure)
tar -zcf $@ ctags-$*
ctags-%.tar.Z: ctags-%.tar.gz
tar -Zcf $@ ctags-$*
vim-ctags-%.tar.gz: ctags-%.tar.gz
@ echo "---------- Building Vim tar ball"
if [ -d vim ] ;then rm -fr vim ;fi
mkdir -p vim
cp -pr ctags-$* vim/ctags
( cd vim/ctags ;\
mv README README.txt ;\
rm COPYING QUOTES ;\
echo "You can obtain a copy of the GNU General Public License from the GNU web" >> COPYING ;\
echo "site at http://www.gnu.org/copyleft/gpl.html, or from the Exuberant Ctags" >> COPYING ;\
echo "web site at http://darren.hiebert.com/ctags/gpl.html, or by writing to" >> COPYING ;\
echo "the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston," >> COPYING ;\
echo "MA 02111-1307 USA" >> COPYING ;\
chmod 644 COPYING ;\
)
cd vim; tar -zcf ../$@ ctags
$(CTAGS_DOSDIR)/ctags%: FORCE
if [ -d $(CTAGS_DOSDIR)/ctags$* ] ;\
then rm -fr $(CTAGS_DOSDIR)/ctags$*/* ;\
else mkdir -p $(CTAGS_DOSDIR)/ctags$* ;\
fi
dos1-%: $(DOS_FILES)
for file in $^ ;do \
unix2dos $${file} $(CTAGS_DOSDIR)/ctags$*/$${file} ;\
done
mv $(CTAGS_DOSDIR)/ctags$*/Makefile.amiga \
$(CTAGS_DOSDIR)/ctags$*/Makefile.ami
cd $(CTAGS_DOSDIR); mv makefile makefile.bak; \
sed -e 's/^\(VERSION =\) [0-9]\+/\1 $*/' makefile.bak > makefile
dos2-%: $(VERSION_FILES) ctags.man
for file in $^ ;do \
rm -f $(CTAGS_DOSDIR)/ctags`echo $*|sed 's/\.//g'`/$${file} ;\
sed -e "s/@@VERSION@@/$*/" \
-e "s/@@LSMDATE@@/`date +'%d%b%y' | tr 'a-z' 'A-Z'`/" $${file} |\
unix2dos > $(CTAGS_DOSDIR)/ctags`echo $*|sed 's/\.//g'`/$${file} ;\
done
dos-%:
@ echo "---------- Building MSDOS release directory"
$(MAKE) $(CTAGS_DOSDIR)/ctags`echo $*|sed 's/\.//g'` \
dos1-`echo $*|sed 's/\.//g'` dos2-$*
rpm-%: ctags-%.tar.gz ctags.spec
@ echo "---------- Building RPM"
cp -p ctags-$*.tar.gz $(RPM_ROOT)/SOURCES/
sed -e "s/@@VERSION@@/$*/" ctags.spec > $(RPM_ROOT)/SPECS/ctags-$*.spec
(cd $(RPM_ROOT)/SPECS; rpm -ba ctags-$*.spec)
rm -fr $(RPM_ROOT)/BUILD/ctags-$*
ctags32-%: ctags-%.tar.gz
@ echo "---------- Building DPMS binary for MSDOS"
(cd ctags-$*; $(MAKE) -f ../Makefile ctags32.exe; mv ctags32.exe ..)
rm -f $(CTAGS_DOSDIR)/ctags32.exe
mcopy ctags32.exe $(CTAGS_DOSDIR)
#
# Prevent make from deleting these automatically
#
.PRECIOUS: ctags-%.tar.gz ctags-%.tar.Z vim-ctags-%.tar.gz
cleanrelease-%:
rm -f ctags-$*.tar.gz vim-ctags-$*.tar.gz
rm -fr ctags-$*
rm -fr $(CTAGS_DOSDIR)/ctags`echo $*|sed 's/\.//g'`
rm -f $(RPM_ROOT)/SOURCES/ctags-$*.tar.gz
rm -f $(RPM_ROOT)/RPMS/i386/ctags-$*-1.i386.rpm
rm -f $(RPM_ROOT)/SRPMS/ctags-$*-1.src.rpm
rm -f $(RPM_ROOT)/SPECS/ctags-$*.spec
release-%: ctags-%.tar.gz ctags-%.tar.Z vim-ctags-%.tar.gz dos-% rpm-% ctags32-%
@ echo "---------- Copying files to web archive"
cp -p ctags-$*.tar.* $(WEB_ARCHIVE_DIR)
cp -p $(RPM_ROOT)/RPMS/i386/ctags-$*-1.i386.rpm $(WEB_ARCHIVE_DIR)
cp -p $(RPM_ROOT)/SRPMS/ctags-$*-1.src.rpm $(WEB_ARCHIVE_DIR)
cp -p ctags-$*/ctags.lsm $(WEB_ARCHIVE_DIR)/ctags-$*.lsm
chmod o+r $(WEB_ARCHIVE_DIR)/*
@ echo "---------- Release $* completed"
#
# Dependency file generation
#
$(DEP_DIR)/%.d: %.c Makefile.maint
@ if [ ! -d $(DEP_DIR) ] ;then mkdir -p $(DEP_DIR) ;fi
@ $(CC) -M $(DCFLAGS) $< | sed 's/\($*\.o\)\([ :]\)/\1 $*.od $(@F)\2/g' > $@
%.inc: %.c Makefile
-@ $(CC) -MM $(DCFLAGS) $<
#
# Compilation rules
#
%.o : %.c $(DEP_DIR)/%.d
@ echo "-- Compiling $*.c"
@ $(CC) $(CFLAGS) -DEXTERNAL_SORT $(OPT) $(WARNINGS) -Wuninitialized -O -c $< $(REDIR)
%.od : %.c $(DEP_DIR)/%.d
@ echo "-- Compiling (debug) $*.c"
@ $(CC) -g $(DCFLAGS) $(WARNINGS) -o $*.od -c $< $(REDIR)
%.i : %.c $(DEP_DIR)/%.d FORCE
$(CC) $(DCFLAGS) $(WARNINGS) -Wuninitialized -O -E $< > $@ $(REDIR)
%.ic : %.c $(DEP_DIR)/%.d FORCE
$(CC) $(DCFLAGS) $(WARNINGS)